/*
 * @Author: yanjikun
 * @Date: 2022-04-12 16:56:29
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-04-14 09:32:11
 * @Description: file content
 */

import { EChartsOption } from 'echarts'
import { ExtractPropTypes, PropType } from 'vue'
import { ChartThemeType } from './types/chart'

export const basicChartProps = {
  /**图表数据请求接口 */
  dataRequest: {
    type: Function as PropType<(params: any) => Promise<EChartsOption | false>>
  },
  /**图表数据Option */
  dataSource: {
    type: Object as PropType<EChartsOption>
  },
  /**图表主题 */
  theme: {
    type: String as PropType<ChartThemeType>,
    default: 'default'
  },
  /**加载时是否立即获取数据 */
  immediate: {
    type: Boolean as PropType<boolean>,
    default: true
  }
}

export type BasicChartProps = ExtractPropTypes<typeof basicChartProps>
